from  flask import  Flask,url_for
from  common.libs.UrlManager import UrlManager
from  flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:123456@127.0.0.1/mysql'
db = SQLAlchemy(app)

@app.route('/')
def hello_world ():
    from  sqlalchemy import text
    sql = text('select * from `user`')
    result = db.engine.execute(sql)
    for row in result:
        app.logger.info(row)

    return "hello world"


@app.route('/api')
def index ():
    return  "index page"
if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True)
